{extend name="layout" /}
{block name="content"}
<div class="mui-content">
	<form id="formid">
	<div class="uk-margin-small-bottom">
		<ul class="mui-table-view">
			<li class="mui-table-view-cell mui-media">
				<img class="mui-pull-left uk-margin-xsmall-right" src="{$images_path}tm-pay-icon-alipay.png" width="36" height="36">
				<div class="mui-media-body" style="margin-top: 8px;">
					<span class="mui-ellipsis">支付宝支付</span>
					<input class="mui-ellipsis" type="radio" value="1" name="paytype" style="float: right;width: 20px;height: 20px;" checked />
				</div>
				</div>
			</li>
			<li class="mui-table-view-cell mui-media">
				<img class="mui-pull-left uk-margin-xsmall-right" src="{$images_path}tm-pay-icon-wx.png" width="36" height="36">
				<div class="mui-media-body" style="margin-top: 8px;">
					<span class="mui-ellipsis">微信支付</span>
					<input class="mui-ellipsis" type="radio" value="2" name="paytype" style="float: right;width: 20px;height: 20px;" />
				</div>
			</li>
		</ul>
	</div>
	<div>
		<div class="mui-table-view mui-in-zero">
			<div class="mui-table-view-cell mui-media no-active-bg">
				<div class="mui-table">
					<div class="mui-table-cell uk-text-middle uk-width-1-4">
						<span>充值金额</span>
					</div>
					<div class="mui-table-cell uk-text-middle">
						<div class="uk-input-blank">
							<input class="uk-input" type="text" name="totalprice" value="" placeholder="请输入充值金额" />
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	</form>
	<div class="tm-padded-medium">
		<div>
			<button class="mui-btn mui-btn-warning mui-btn-medium uk-width-1-1 cocoPostFormAjax" type="button" ajaxurl="{:url('v1/order_amount/chongzhi')}" formid="formid" ajax-callback="suc_back">立即充值</button>
		</div>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	function suc_back (obj, data) {
		if (data.paytype == 1) {
			document.location = 'http://coco3g-app/payonline?type=alipay&orderid='+data.ordersn+'&goodsname='+data.ordername+'&goodsdetail='+data.ordername+'&price='+data.totalprice+'&callbackTag=callback_14889564988';
		}else if (data.paytype == 2) {
			document.location = 'http://coco3g-app/payonline?type=weixin&orderid='+data.ordersn+'&goodsname='+data.ordername+'&goodsdetail='+data.ordername+'&price='+data.totalprice+'&callbackTag=callback_14889564988';
		}
	}
</script>
{/block}